<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/8/31
  Time: 14:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<link rel="stylesheet" href="dist/css/bootstrap.min.css">
<link rel="stylesheet" href="dist/css/laypage.css">
<link rel="stylesheet" href="dist/js/laypage/skin/laypage.css">
<script type="text/javascript" src="dist/js/vue/vue.min.js"></script>
<script type="text/javascript" src="dist/js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="dist/js/laypage/laypage.js" charset="utf-8"></script>
<script type="text/javascript" src="dist/js/layer/layer.js" charset="utf-8"></script>

<html>
<head>
    <title>会员列表</title>
    <style type="text/css">
        /* *{
             border: solid;
         }*/


    </style>

</head>
<body>
<hr>
<div id="app" class="container">
    <form class="form-inline bg-danger" role="form">
        <hr>
        <button type="submit" class="btn btn-default">搜索</button>
        <div class="form-group">
            <label class="sr-only" for="mname">用户名称</label>
            <input name="mname" type="text" class="form-control" id="mname" placeholder="用户名称">
        </div>
        <div class="form-group">
            <label class="sr-only" for="maccount">用户账号</label>
            <input name="maccount" type="text" class="form-control" id="maccount" placeholder="用户账号">
        </div>
        <hr>
        <button type="button" id="findUser" class="btn btn-success">查询用户</button>
        <button type="button" id="addUserBtn" class="btn btn-danger">增加用户</button>
    </form>

    <hr>
    <div class="table-responsive">
        <table class="table">
            <thead>
            <tr class="success">
                <td>序号</td>
                <td>用户</td>
                <td>手机</td>
                <td>角色</td>
                <td>邮箱</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody>
            <tr class="active" v-for="(item,index) in result">
                <td>{{index+1}}</td>
                <td>{{item.mname}}</td>
                <td>{{item.maccount}}</td>
                <td>{{item.mpwd}}</td>
                <td>{{item.mphone}}</td>
                <td><a href="">编辑</a> | <a href="">删除</a></td>
            </tr>
            </tbody>
        </table>
        <div id="pagenav"></div>
    </div>


</div>
</body>
</html>
<script type="text/javascript">

    var app=new Vue({
        el:"#app",
        data:{
            result:[]
        }
    });

    /*111用户信息列表*/
    var searchMemberByConditions=function(currPageNo){
        console.log("111调用searchMemberByConditions函数");
        $.ajax({
            type:"post",
            url:"member_searchMemberByConditions",
            data:{
                /*mname:$("input[name=mname]").val(),*/
                mname:"",
                maccount:$("input[name=maccount]").val(),
                currPageNo:currPageNo||1,
                maxRows:5,
            },
            dataType:"json",
            success:function (msg) {
                console.log("111===msg");
                console.log(msg);
                app.result=msg.list;


                laypage({
                    cont: 'pagenav',  //存放分页的容器
                    pages: msg.totalPages,  //总页数
                    skin: '#36648B',
                    first: '第一页',
                    last: '最后一页',
                    curr: currPageNo||1,
                    jump: function (obj, first) {
                        if (!first) {
                            console.log("obj.currPageNo========");
                            console.log(obj.curr);
                            searchMemberByConditions(obj.curr);
                        }
                    }
                });
            }
        });
    }
    searchMemberByConditions();
    $("#findUser").click(function () {
        searchMemberByConditions();
    })




</script>
